package com.njupt.listener;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * @Author: XJL
 * @Description:
 * @Date: Create in 21:47 2018/6/1
 * @Modified By:
 **/
public class MyMessageListener implements MessageListener {
    @Override
    public void onMessage(Message message) {

        try {
            //接收到消息
            TextMessage textMessage = (TextMessage) message;
            String text = textMessage.getText();
            System.out.println(text);
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
